

<template>
  <div class="banklogin">
    
    <input type="text" v-model="uname" placeholder="邮箱/手机号码/小米ID" />
    <input type="text" v-model="pwd" placeholder="密码" />
    <template>
    <a-button @click="success"   class="login" >
      登录
      <!-- <div class="login" @click="login" >登录</div> -->
    </a-button>
    </template>
    <div class="details">
      
      <span class="leftwords">手机短信登录/注册</span>
      <span class="rigthwords">
      <span @click="reg">立即注册 </span>
      <span>|</span>
      <span>忘记密码？</span>
      </span>
    </div>
    <!-- <modal
      :title="'提示'"
      v-show="isShow"
      @submit="goCart"
      @cancel="isShow = false"
      :btnType="2"
    >
      <template v-slot:body>
        <div class="msg">登录成功</div>
      </template>
    </modal> -->
  </div>
</template>

<script>
import { message } from 'ant-design-vue';
export default {
data:()=>{
    return{
        uname:"13534017363",
        pwd:"123",
        ob:null,
        
    }
},
 methods:{
        success(){
           this._axios.post('http://newshopapi.0melon0.cn/api/login',
           {
               phone:this.uname,
               password:this.pwd,
           }
           ).then((res)=>{
             console.log(res);
            //  alert("登陆成功");
             message.success('登录成功',0.5);
             this.ob=res.data.result.token
             sessionStorage.setItem('x-token',this.ob)
              this.$router.push({path:'/index'})
       
           }).catch((err)=>{
             if(err){
               message.error('账号或者密码输入错误',1);
             }
            
           })

       } ,
       reg(){
         this.$router.push({path:'/regist'})
       },
    //     success(){
    //   message.success('This is a success message');
    // },
  },
}
</script>

<style lang="scss" scoped>

.banklogin {

  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: center;
  width: 410px;
  height: 410px;

  input {
    width: 348px;
    height: 50px;
    border: solid 1px #e5e5e5;
    font-size: 14px;
    font-weight: bold;
    font-stretch: normal;
    color: #999999;
  }
  .login {
    font-size: 16px;
    font-weight: bold;
    font-stretch: normal;
    line-height: 50px;
    letter-spacing: 0px;
    color: #ffffff;
    width: 348px;
    height: 50px;
    text-align: center;
    background-color: #ff6600;
  }
  .details {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    width: 348px;
    height: 50px;
    font-size: 14px;
    font-weight: bold;
    font-stretch: normal;
    letter-spacing: 0px;
    .leftwords {
      color: #ff6600;
    }
    .rightwords {
      color: #999999;
    }
  }
}
</style>